package com.view.cn.mvprxjava.model;

import com.view.cn.mvprxjava.callback.UserOnResponse;
import com.view.cn.mvprxjava.comm.RequestCodeComm;

/**
 * 处理数据和业务逻辑的工作都放在model里面来做，fragment或者activity值负责显示展示数据
 * 逻辑的工作都放在model里面来做，fragment或者activity值负责显示展示数据
 * <p/>
 * 比如：验证账号密码正确与否，或者时候满足长度等
 * Created by Zengxiaoping on 2016/9/22.
 */
public class UserModel {

	private UserOnResponse mUserOnResponse;

	public void getUserInfo(String userName, String userPwd, final UserOnResponse userOnResponse) {
		this.mUserOnResponse = userOnResponse;
		if (userName.equals("zxp123") && userPwd.equals("123456")) {
			userOnResponse.success(RequestCodeComm.USER_CODE_GET_USER_INFO, null, "用户信息请求成功");
		} else {
			userOnResponse.userNameError(RequestCodeComm.USER_CODE_GET_USER_INFO, null, "用户账户或密码错误");
		}
	}
}
